set name="Distributed_Streaming_Join_VLDB14"

@echo off
del /F %name%.pdf

if exist %name%.pdf (goto err)

latex %name%.tex
bibtex %name%
latex %name%.tex
latex %name%.tex
dvips -P pdf -t letter -o %name%.ps %name%.dvi
ps2pdf %name%.ps %name%.pdf

delete_tmp.bat
goto end

:err
@echo Error: PDF file is in use!
pause

:end
@echo "OK!"
